#include "Billboard.h"
//some code infuenced by http://www.lighthouse3d.com/opengl/billboarding/index.php?billCheat1

void SetBillboard()
{
	float modelview[16];

	// get the current modelview matrix
	glGetFloatv(GL_MODELVIEW_MATRIX , modelview);

	// The only difference now is that
	// the i variable will jump over the
	// up vector, 2nd column in OpenGL convention

	for(int i = 0; i < 3; i += 2) 
	{
		for(int j = 0; j < 3; j++) 
		{
			if (i==j)
			{
				modelview[i*4+j] = 1.0;
			}
			else
			{
				modelview[i*4+j] = 0.0;
			}
		}
	}

	glLoadMatrixf(modelview);
}